//
//  TTOrderDiamondTableViewCell.m
//  TaoTuo
//
//  Created by apple on 2020/12/11.
//  Copyright © 2020 刘广. All rights reserved.
//

#import "TTOrderDiamondTableViewCell.h"
#import "TTLuoshiCellView.h"

@interface TTOrderDiamondTableViewCell ()

@property (nonatomic, strong) TTLuoshiCellView *luoshiView;
@property (nonatomic, strong) UIView *hintView;
@property (nonatomic, strong) UIImageView *hintImageView;
@property (nonatomic, strong) UILabel *hintLabel;

@end

@implementation TTOrderDiamondTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupSubviews];
        
    }
    return self;
}


- (void)setDetailModel:(TTCustomChooseLuoshiModel *)detailModel
{
    _detailModel = detailModel;
    
    self.luoshiView.detailModel = detailModel;
    
    // 如果是被镶嵌的改变一下样式
}

- (void)setupSubviews
{
    _luoshiView = [[TTLuoshiCellView alloc] init];
    [self.contentView addSubview:_luoshiView];
    [_luoshiView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(10);
        make.left.mas_equalTo(15);
        make.right.equalTo(self.contentView.mas_right).offset(-10);
        make.height.mas_equalTo(100);
    }];
    
    _hintView = [[UIView alloc] init];
    _hintView.backgroundColor = [UIColor grayColor];
    [self.contentView addSubview:_hintView];
    [_hintView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.luoshiView.mas_bottom);
        make.left.right.equalTo(self.luoshiView);
        make.height.mas_equalTo(36);
    }];
    
    _hintImageView = [[UIImageView alloc] init];
    _hintImageView.contentMode = UIViewContentModeScaleAspectFit;
    [self.hintView addSubview:_hintImageView];
    [_hintImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.centerY.equalTo(self.hintView);
        make.width.height.mas_equalTo(20);
    }];
    
    _hintLabel = [UILabel labelWithTitle:@"" color:UIColorHex(333333) fontSize:13];
    [self.contentView addSubview:_hintLabel];
    [_hintLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.hintImageView.mas_right).offset(5);
        make.right.equalTo(self.hintView);
        make.centerY.equalTo(self.hintView);
    }];
    
    
}


@end
